<template>
    <div style="padding: 20px;">
        <!-- 详情 1-设计师 2-工作室 3-企业-->
        <el-descriptions class="margin-top" title="基本信息" :column="3">
            <el-descriptions-item :label="authTypeDict[type - 1].label + '名称'">{{ rowInfo.name }}</el-descriptions-item>
            <el-descriptions-item :span="2" v-if="type == 2" label="成立时间">{{
                dict.type.auth_establish_year[rowInfo.establishYear - 1].label }}</el-descriptions-item>
            <el-descriptions-item v-if="type != 1" label="联系人">{{ rowInfo.contact }}</el-descriptions-item>
            <el-descriptions-item label="联系方式">{{ rowInfo.contactNumber }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 3" label="公司地址">{{ rowInfo.address }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 3" label="证件类型">{{ dict.type.enterprise_id_type[rowInfo.idType].label
            }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 3" :span="2" label="信用代码">{{ rowInfo.socialCreditCode
            }}</el-descriptions-item>

            <el-descriptions-item v-if="type == 3" label="法人代表名称">{{ rowInfo.legalRepresentativeName
            }}</el-descriptions-item>
            <el-descriptions-item label="身份证号码" :span="2">{{ rowInfo.idNumber }}</el-descriptions-item>

            <el-descriptions-item :span="3" label="身份证照片国徽面">
                <div class="demo-image__preview">
                    <el-image style="width: 100px; height: 100px" :src="rowInfo.idPhoto0"
                        :preview-src-list="[rowInfo.idPhoto0]">
                    </el-image>
                </div>
            </el-descriptions-item>
            <el-descriptions-item :span="3" label="身份证照片人像面">
                <div class="demo-image__preview">
                    <el-image style="width: 100px; height: 100px" :src="rowInfo.idPhoto1"
                        :preview-src-list="[rowInfo.idPhoto1]">
                    </el-image>
                </div>
            </el-descriptions-item>
            <el-descriptions-item :span="3" v-if="type == 3" label="营业执照">
                <div class="demo-image__preview">
                    <el-image style="width: 100px; height: 100px" :src="rowInfo.businessLicensePhoto"
                        :preview-src-list="[rowInfo.businessLicensePhoto]">
                    </el-image>
                </div>
            </el-descriptions-item>

            <el-descriptions-item v-if="type == 1" label="紧急联系人">{{ rowInfo.emergencyContact }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" :span="2" label="联系方式">{{
                rowInfo.emergencyContactNumber }}</el-descriptions-item>

            <!-- 设计师
            1、注意字典中键值和排序对应的内容
            2、没有对应字典，需在字典管理处添加或其他操作-->
            <el-descriptions-item v-if="type == 1" label="最高学历">{{ dict.type.auth_highest_edu[rowInfo.highestEducation].label }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" label="毕业院校">{{ rowInfo.university }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" label="毕业专业">{{ rowInfo.major }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" label="工作年限">{{ rowInfo.workSeniority }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" label="目前工作状态">{{ dict.type.auth_work_status[rowInfo.currentWorkingStatus-1].label
            }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" label="期望月收入">{{ rowInfo.expectedMonthlyIncome
            }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 1" :span="3" label="工作经历">{{ rowInfo.idNumber }}</el-descriptions-item>

            <!--  工作室  字典相关修改类似设计师-->
            <el-descriptions-item v-if="type != 1" :label="type == 2 ? '开户' : '' + '银行账号'">{{ rowInfo.bankAccountNumber
            }}</el-descriptions-item>
            <el-descriptions-item v-if="type != 1" :label="type == 2 ? '开户' : '' + '银行名称'">{{ rowInfo.bankAccountName
            }}</el-descriptions-item>
            <el-descriptions-item v-if="type != 1" :label="type == 2 ? '开户' : '' + '支行名称'">{{
                rowInfo.bankAccountBranchName
            }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 2" :span="3" label="擅长设计风格">{{ rowInfo.styleId }}</el-descriptions-item>
            <el-descriptions-item v-if="type == 2" :span="3" label="擅长品类">{{ rowInfo.domainIdList
            }}</el-descriptions-item>


            <el-descriptions-item v-if="type != 3" label="所在城市">{{ rowInfo.provinceName + rowInfo.cityName +
                rowInfo.countyName
            }}</el-descriptions-item>

        </el-descriptions>


        <el-descriptions v-if="type != 3" class="margin-top" title="作品集" :column="3"
            v-for="( w, i ) in   rowInfo.worksList " :key="i">
            <el-descriptions-item label="作品名">{{ w.name }}</el-descriptions-item>
            <el-descriptions-item label="类型">{{ w.type }}</el-descriptions-item>
            <el-descriptions-item label="链接">{{ w.link }}</el-descriptions-item>
            <el-descriptions-item :span="3" label="作品图">
                <div class="demo-image__preview">
                    <el-image style="width: 100px; height: 100px" :src="w.photo" :preview-src-list="[w.photo]">
                    </el-image>
                </div>
            </el-descriptions-item>
        </el-descriptions>
        <!-- 学校 -->
        <el-descriptions v-if="type == 1" class="margin-top" :title="'学校经验-' + (i + 1)" :column="3"
            v-for="( ee, i ) in   rowInfo.eduExperiences " :key="i">
            <el-descriptions-item label="majon">{{ ee.majon }}</el-descriptions-item>
            <el-descriptions-item label="学校名字">{{ ee.idNumbtype }}</el-descriptions-item>
            <el-descriptions-item label="起止时间">{{ ee.startDate + '-' + ee.graduateDate }}</el-descriptions-item>

        </el-descriptions>
        <!-- 工作经验 -->
        <el-descriptions v-if="type == 1" class="margin-top" :title="'工作经验-' + (i + 1)" :column="3"
            v-for="( we, i ) in   rowInfo.workExperiences " :key="i">
            <el-descriptions-item label="公司名称">{{ we.name }}</el-descriptions-item>
            <el-descriptions-item label="职业">{{ we.idNumbtype }}</el-descriptions-item>
            <el-descriptions-item label="起止时间">{{ we.startDate + '-' + we.resignDate }}</el-descriptions-item>
        </el-descriptions>
        <!-- 企业类别 -->
        <el-descriptions v-if="type == 3" class="margin-top" title="企业类别" :column="3">
            <el-descriptions-item label="企业类型">{{ dict.type.auth_enterprise_type[rowInfo.enterpriseType - 1].label
            }}</el-descriptions-item>
            <el-descriptions-item label="企业主营品类">{{ rowInfo.mainBusinessTypeId }}</el-descriptions-item>
        </el-descriptions>


    </div>
</template>

<script>

export default {
    name: "Auth",
    props: ['rowInfo', 'type'],
    dicts: ['auth_establish_year', 'auth_enterprise_type', 'enterprise_id_type','auth_highest_edu','auth_work_status'],
    data() {
        return {
            title: '',
            authTypeDict: [
                { value: 1, label: '设计师' },
                { value: 2, label: '工作室' },
                { value: 3, label: '企业' },
            ],
        }
    },


}
</script>